// 挂载
import Vue from 'vue'
import VueRouter from 'vue-router'

// 主页面
import Home from '../views/Home.vue'
import Community from '../views/Community'
import Renting from '../views/Renting.vue'
import Message from '../views/Message.vue'
import Login from '../views/Login.vue'
import NotoFunt from '../views/NotFount.vue'
import User from '../views/User'
// 评论组件
import Comment from '../components/Comment.vue'
// 生活详情
// import LifeDetails from "../components/LifeDetails"
// 生活分享预览
// import LifeShare from "../components/LifeShare"
// 找室友详情
// import MateDetails from '../components/MateDetails'

// 个人房源预览
// import PrivateRoom from '../components/PrivateRoom'

// 个人房源详情
// import PrivateDetails from '../components/PrivateDetails'

// 城市选择
import City from '../views/City'

// 房源预约
import Order from '../components/Order.vue'

// 搜索页
import SearchPage from '../views/SearchPage'
// 房源预约
// import Roomdetails from '../components/Roomdetails'

// 用户中心
import UserCenter from '../views/UserCenter'
// 预约单
import Bill from '../components/Bill'
// 收藏页
import Collect from "../components/Collect"
// 历史页
import History from '../components/History'

// 群聊测试 
import WebSocketTest from '../components/WebSocketTest'

//筛选
import Select from '../components/Select'
// 新底部导航栏
import Map from '../views/Map'



Vue.use(VueRouter)

const routes = [{
    // 重定向根路径到home
    path: '/',
    redirect: '/home'
  },
  {
    path: '/map',
    name: "map",
    component: Map
  },
  {
    path: '/select',
    name: 'select',
    component: Select
  },
  {
    path: '/history',
    name: 'history',
    component: History
  },
  {
    path: '/WebSocketTest',
    name: 'WebSocketTest',
    component: WebSocketTest
  },
  {
    path: '/collect',
    name: 'collect',
    component: Collect
  },
  {
    path: '/bill',
    name: 'bill',
    component: Bill
  },


  {
    path: '/home',
    name: 'home',
    component: Home,
  },
  {
    path: '/comment',
    name: 'comment',
    component: Comment,

  },

  {
    path: '/order',
    name: 'order',
    component: Order,
  },
  {
    path: '/community',
    name: 'community',
    component: Community,
    children: [{
        path: 'privatroom',
        name: 'privatroom',
        component: () => import(/* webpackChunkName: "privatroom" */ '../components/PrivateRoom')
      },
      {
        path: 'privateDetails',
        name: 'privateDetails',
        component: () => import(/* webpackChunkName: "privateDetails" */ '../components/PrivateDetails')
      },

      {
        path: 'mateDetails',
        name: 'mateDetails',
        component: () => import(/* webpackChunkName: "mateDetails" */ '../components/MateDetails')
      },
      {
        path: 'lifeshare',
        name: 'lifeshare',
        component: () => import(/* webpackChunkName: "lifeshare" */ "../components/LifeShare")

      },
      {
        path: 'lifedetails',
        name: 'lifedetails',
        component: () => import(/* webpackChunkName: "lifedetails" */ "../components/LifeDetails")

      }
    ]

  },
  {
    path: '/Renting',
    name: 'Renting',
    component: Renting,
    children: [{
      path: "roomDetails",
      name: "roomDetails",
      component: () => import(/* webpackChunkName: "roomDetails" */ '../components/Roomdetails')
    }]
  },
  {
    path: '/message',
    name: 'message',
    component: Message,

  },
  {
    path: '/login',
    name: 'login',
    component: Login,

  },
  {
    path: '*',
    component: NotoFunt,
  },
  {
    path: '/user',
    name: 'user',
    component: User
  },
  {
    path: '/city',
    name: 'City',
    component: City
  },
  {
    path: '/searchPage',
    name: 'searchPage',
    component: SearchPage

  },
  {
    path: '/usercenter',
    name: 'usercenter',
    component: UserCenter
  }
  
]

const router = new VueRouter({
  routes
})

export default router